﻿/*
最短距离的点 
Time Limit:1000MS  Memory Limit:32768K

  
	Description:
	给出一些整数对，它们表示一些平面上的坐标点，给定一个点，求所有那些点到该点最短距离的点
	。结构为：第一个整数对为所给定的点，后面的整数对为所有其他的点。
	
	  Sample Input:
	  9 2
	  1 0
	  1 1
	  0 0
	  1 2
	  2 1
	  Sample Output:
	  2 1
*/
#include <iostream>
#include <climits>
using namespace std;

class Point
{
public:
	Point(int x=0, int y=0):_x(x), _y(y){}
	Point& operator=(Point another)
	{
		_x=another._x;
		_y=another._y;
		return *this;
	}
	friend ostream& operator<<(ostream &os, const Point& pt);
	friend istream& operator>>(istream &is, Point& pt);
	
	int operator-(Point another)
	{
		return (_x-another._x)*(_x-another._x)+(_y-another._y)*(_y-another._y);
	}

private:
	int _x, _y;
};

ostream& operator<<(ostream &os, const Point& pt)
{
	os<<pt._x<<' '<<pt._y<<endl;
	return os;
}
istream& operator>>(istream &is, Point& pt)
{
	is>>pt._x>>pt._y;
	return is;
}

int main(int argc, char* argv[])
{
	Point first_pt, min_pt;	
	int minimum=INT_MAX, dist;
	int x, y;

	cin>>first_pt;
	while(cin>>x>>y)
	{
		Point pt(x, y);
		dist=pt-first_pt;
		if(minimum>dist)
		{
			minimum=dist;
			min_pt=pt;
		}		
	}
	cout<<min_pt;

	return 0;
}
